<template>
  <div>
    <el-tag>跟进记录</el-tag>
    <div v-for="item in dataList" style="font-size: 10px">
      <el-row>
        <el-col :span="8"><span>操作人</span></el-col>
        <el-col :span="16"><span>{{item.operName}}</span></el-col>
      </el-row>
      <el-row>
        <el-col :span="8"><span>操作时间</span></el-col>
        <el-col :span="16"><span>{{item.operTime}}</span></el-col>
      </el-row>
      <el-row v-if="item.operParam.record">
        <el-col :span="8"><span>详情</span></el-col>
        <el-col :span="16"><span>{{item.operParam.record}}</span></el-col>
      </el-row>
      <el-row v-if="item.operParam.reason">
        <el-col :span="8"><span>伪线索原因</span></el-col>
        <el-col :span="16"><span>{{item.operParam.reason}}</span></el-col>
      </el-row>
      <el-row v-if="item.operParam.remark">
        <el-col :span="8"><span>详情</span></el-col>
        <el-col :span="16"><span>{{item.operParam.remark}}</span></el-col>
      </el-row>
      <hr>
    </div>
  </div>
</template>

<script>
  import {list} from "@/api/monitor/operlog";
  export default {
        name: "track-list",
        props:['id'],
    data(){
          return{
           dataList:[],
          }
    },
    created() {
         this.getList();
    },
    methods: {
          getList(){
           list({title:'线索跟踪记录'}).then(res=>{
             // console.log(res)
              this.dataList=this.parseData(res.rows);
             // console.log(this.dataList)
           })
      },
      parseData(result){
       let list=[];
       if(result && result.length>0){
         for (let item of result){
           let operParam = (JSON.parse(item.operParam))
           console.log(operParam)
           console.log(this.id)
           if(operParam.id == this.id){
            item.operParam = operParam
             list.push(item)
           }
         }
       }
         return  list;
      }
    }
  }
</script>

<style scoped>

</style>
